/*
 * @Descripttion:
 * @Author: cuidm
 * @Date: 2021-01-21 14:07:42
 * @LastEditors: cuidm
 * @LastEditTime: 2022-09-27 10:59:39
 */
import ReactDOM from "react-dom";
import {
  isInIcestark,
  getMountNode,
  registerAppEnter,
  registerAppLeave,
} from "@ice/stark-app";
import "./global.less";
import "./assets/myFont/myFont.css";
import "./assets/iconfont/iconfont.css";
import router from "./router";
import 'antd/dist/antd.css';
// require("echarts-liquidfill/dist/echarts-liquidfill.min.js");
require("./assets/iconfont/iconfont.js");

if(THEME_NAME && THEME_NAME !== "") {
  require('./global.'+ THEME_NAME +'.less');
}
console.log('isInIcestark()', isInIcestark());
if (isInIcestark()) {
  const mountNode = getMountNode();

  registerAppEnter(() => {
    ReactDOM.render(router(), mountNode);
  });

  // make sure the unmount event is triggered
  registerAppLeave(() => {
    ReactDOM.unmountComponentAtNode(mountNode);
  });
} else {
  ReactDOM.render(router(), document.getElementById("ice-container"));
}
